package nccu.dao.hibernate;

import nccu.dao.CreditUnionDao;
import nccu.model.CreditUnion;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * This class interacts with Spring's HibernateTemplate to save/delete and
 * retrieve CreditUnion objects.
 *
 * @author <a href="mailto:chris.oberle@gmail.com">Chris Oberle</a>
*/
@Repository("creditUnionDao")
public class CreditUnionDaoHibernate extends GenericDaoHibernate<CreditUnion, Long> implements CreditUnionDao {

    public CreditUnionDaoHibernate() {
        super(CreditUnion.class);
    }

    public List<CreditUnion> findByName(String name) {
        return getHibernateTemplate().find("from CreditUnion where name=?", name);
    }
}
